package com.gimi.cloud.bbp.dao.dao.homePage;

import com.gimi.cloud.bbp.dao.myMapper.MyMapper;
import com.gimi.cloud.bbp.dto.app.AdDTO;
import com.gimi.cloud.bbp.entity.app.AdEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by shazhiwei on 2017/12/27.
 */
public interface AdDao extends MyMapper<AdEntity>{

    /**
     * 根据栏目id查所有已发布的广告
     */
    @Select("select * from jimi_ad where column_id = #{columnId} and ad_status = 'd'")
    List<AdDTO> getByColumnId(@Param(value = "columnId") Integer columnId);

    /**
     * 根据栏目id列表(1,2,3)查所有已发布的广告
     */
    @Select("select * from jimi_ad where column_id IN (#{columnIds}) and ad_status = 'd'")
    List<AdDTO> getListByColumnIds(@Param(value = "columnIds") String columnIds);
    /**
     * 获得广告列表（分页），支持条件查询
     * @param adDTO
     * @return
     */
    List<AdDTO> queryPageList(AdDTO adDTO);


}
